package cn.com.idmy.cloud.controller;

import cn.com.idmy.base.annotation.Whitelist;
import cn.com.idmy.cloud.util.BizEnumUtil;
import cn.com.idmy.cloud.util.BizEnumUtil.IEnumOut;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class BizEnumController {
    @Whitelist
    @RequestMapping("/api/enum/all")
    Map<String, List<IEnumOut>> all() {
        return BizEnumUtil.all();
    }

    @Whitelist
    @RequestMapping("/api/enum/listByClass/{className}")
    List<IEnumOut> listByClass(@PathVariable String className) {
        return BizEnumUtil.get(className);
    }
}